package org;

import javafx.application.Application;
import javafx.application.Platform;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import org.winFame.PaneFrame;
import org.winFame.dispy.ThreadGetData;

/**
 * Hello world!
 *
 */
public class App extends Application
{
    public static Stage stage;
    public static boolean keyWod = false;
    public static int downLen = 0;
    public static String downLoadPath="";
    public static void main( String[] args )
    {
        Application.launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        ThreadGetData.pageIndex = 1;
        App.keyWod = false;
        Thread t = new Thread(new ThreadGetData());
        t.start();
        stage = primaryStage;
        stage.setTitle("www.snailcatmall.com - SD模型批量下载工具"+" 下载队列： "+App.downLen);
        stage.setWidth(980);
        stage.setHeight(710);
        stage.setScene(new Scene(PaneFrame.pane));
        stage.getIcons().add(new Image("ico.png"));
        //        配置全局通用样式
        stage.getScene().getStylesheets().addAll(this.getClass().getClassLoader().getResource("style.css").toExternalForm());
        stage.show();
        stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
            @Override
            public void handle(WindowEvent event) {
                Platform.exit();
                System.exit(0);
            }
        });
    }
}
